package bean;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class MemberDTO {
	
	private MemberVo vo;
	private Connection conn;
	
	public MemberDTO() {
		conn=new MyOracle().getConn();
	}

	public boolean login(){
		boolean b=false;
		try {
			String sql="select mid, pwd from member where mid=? and pwd=?";
			PreparedStatement pst=conn.prepareStatement(sql);
			pst.setString(1, vo.getMid());
			pst.setString(2, vo.getPwd());
			
			ResultSet rs=pst.executeQuery();
			if(rs.next()) b=true;
			
			pst.close();
			conn.close();
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		return b;
	}
	
	public Connection getConn() {
		return conn;
	}

	public void setConn(Connection conn) {
		this.conn = conn;
	}

	public MemberVo getVo() {
		return vo;
	}

	public void setVo(MemberVo vo) {
		this.vo = vo;
	}

	
}
